#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>



struct ListNode 
{
	int val;
	struct ListNode* next;
};
 

struct ListNode* mergeTwoLists(struct ListNode* list1, struct ListNode* list2) 
{
	if (list1 == NULL && list2 == NULL)
		return NULL;
	if (list1 == NULL)
		return list2;
	if (list2 == NULL)
		return list1;
	struct ListNode* result = (struct ListNode*)malloc(sizeof(struct ListNode));
	struct ListNode* tmp = result;
	while (list1 != NULL && list2 != NULL)
	{
		if (list1->val < list2->val)
		{
			result->next = list1;
			list1 = list1->next;
		}
		else
		{
			result->next = list2;
			list2 = list2->next;
		}
		result = result->next;
	}
	if (list1 == NULL)
	{
		result->next = list2;
	}
	else
	{
		result->next = list1;
	}

	return tmp->next;
}

struct ListNode* reverseList(struct ListNode* head) 
{
	if (head == NULL)
		return NULL;
	if (head->next == NULL)
		return head;
	// 1 2 3 4 5
	struct ListNode* tmp = head->next;
	struct ListNode* x = NULL;
	struct ListNode* pre = NULL;
	head->next = NULL;
	while (tmp != NULL)
	{
		pre = tmp;
		x = tmp->next;
		tmp->next = head;
		head = tmp;
		tmp = x;
	}

	return pre;
}

/**
 * Return an array of arrays of size *returnSize.
 * The sizes of the arrays are returned as *returnColumnSizes array.
 * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
 */


int** combine(int n, int k, int* returnSize, int** returnColumnSizes) 
{
	int** result = (int**)malloc(sizeof(int*));
	assert(result);

}

int main()
{
	return 0;
}